package com.atguigu.gmall.item.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 自定义线程池  java 类 配置类   applicationContext.xml
 *    <bean class="。。"
 */
@Configuration
public class ThreadPoolConfig {

    @Bean
    public ThreadPoolExecutor threadPoolExecutor(){
        return  new ThreadPoolExecutor(10,
                15,
                10,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue(100)
        );
    }
}
